#include "common.h"

int singleNumber(vector<int>& nums)
{
	int ans = 0;
	for (int i = 0; i < 32; i++)
	{
		int sum = 0;
		for (auto num : nums)
		{
			if ((num >> i) & 1) sum++;
		}
		if (sum % 3 == 1) ans |= (1 << i);
	}
	return ans;
}